package com.ezerg.boot.shiro.service;

import java.util.HashMap;
import java.util.Map;

import org.springframework.stereotype.Component;

import com.ezerg.boot.shiro.bean.UserBean;

@Component
public class UserService {

	Map<String, UserBean> users = new HashMap<>();
	
	public UserService(){
		UserBean user = new UserBean();
		user.setUsername("admin");
		user.setRole("admin");
		user.setPassword("password");
		user.setPermission("admin:view"/*,admin:edit"*/);
		users.put("admin", user);
	}
	
    public UserBean getUser(String username) {
        if (users.containsKey(username)){
            return users.get(username);
        }
        return null;
    }
}

